project(SkiaHelloWorld)
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)

find_library(SKIA_LIB skia ../)

include_directories(../include/)
add_executable(helloworld helloworld.cpp)
target_link_libraries(helloworld ${SKIA_LIB})

add_executable(blenddemo blenddemo.cpp)
target_link_libraries(blenddemo ${SKIA_LIB})

if(APPLE)
  set(PLATFORM_LIB "-framework CoreFoundation -framework CoreText -framework CoreGraphics -framework CoreServices")
else(APPLE)
  find_library(free_type freetype)
  find_library(FONT_LIB fontconfig)
  set(PLATFORM_LIB pthread dl ${free_type} ${FONT_LIB})
endif(APPLE)

target_link_libraries(helloworld ${PLATFORM_LIB})
target_link_libraries(blenddemo ${PLATFORM_LIB})
